package com.txh.blog.mq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MqSend {
    @Autowired
    private AmqpTemplate template;

    public void sendMessage(Long id){
        template.convertAndSend("exchange","topic.message",id);
        System.out.println("发送消息。。。"+id);
    }

}
